#ifndef BOUNDARYCONDITIONS_H
#define BOUNDARYCONDITIONS_H

#include <functional>
#include <string>
#include <vector>
#include <Eigen/Dense>
#include <exprtk.hpp>

class BoundaryConditions {
public:
    BoundaryConditions(const std::string& filename);
    
    // 获取边界条件类型和值
    std::string getType() const;
    double getCondition_1D(double x, size_t index) const; 
    double getCondition_2D(double x, double y, size_t index) const; 

private:
    std::string type;  // 边界条件类型："Dirichlet", "Neumann", or "Mixed"
    std::vector<std::function<double(double)>> conditions_1D;
    std::vector<std::function<double(double, double)>> conditions_2D;  // 边界条件函数集合

    // 问题域参数
    int dimension;
    void loadFromJson(const std::string& filename);
    void generateFun();
};

#endif
